home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / INTRFC61.ARJ / TPU60.DOC < prev    next >
Text File  |  1990-12-19  |  4KB  |  96 lines

  1. This is an outline of the structure of the Turbo Pascal 6.0 TPU file format.
  2.  
  3. I. SYMBOL SECTION
  4.  
  5.  This section contains all the symbolic information, and has several
  6. subsections.
  7.  
  8. The size is given in header.symsize.  Actual size in file is rounded up to
  9. next even paragraph, as are all the sections.
  10.  
  11. A. Header subsection (/H turns display on)
  12.  
  13. Contains sizes, pointers, flags, and signature TPU9.  Structure given in
  14. HEAD.PAS. About $40 bytes, but it's not clear where it ends - the last part is
  15. always zeroed.
  16.  
  17. B. Object subsection (/N turns display off, or /I turns full display on)
  18.  
  19. An unfortunate choice of a name:  this section contains all the symbolic
  20. information, not just for Objects.  It contains one or two hash tables to get
  21. access to the various objects:  the interfaced objects are available from the
  22. one at ofs_hashtable, all debuggable ones are available from the one at
  23. ofs_full_hash.  There are also other smaller hash tables:  members of records,
  24. locals to functions/procedures, etc.  HASH.PAS decodes the hash table.
  25.  
  26. There are basically two types of records:  obj_rec's and type_def_rec's.
  27. Obj_rec's give the name and "type", and are followed by specialized
  28. information describing the object.  Type_def_rec's give constructions for type
  29. definitions.  Both are given in NAMELIST.PAS and NAMETYPE.PAS, though the
  30. type_def_rec's should be handled by their own unit.
  31.  
  32. C. Entry point subsection (/E turns display on)
  33.  
  34. This is an array of fixed length records, one per function/procedure/method in
  35. the unit.  It gives the code block of the routine, and the entry point within
  36. that code block.  The first entry is for the initialization section of the
  37. unit.
  38.  
  39. D. Code block subsection (/D turns display on)
  40.  
  41. This is an array of fixed length records, one per block of code (usually, one
  42. per routine, but .OBJ files get just one block).
  43.  
  44. E. Const block subsection (/C turns display on)
  45.  
  46. Another array of fixed length records, one per block of initialized data.
  47. (This will be a typed Const declaration, or the VMT of an object.
  48.  
  49. F. Var block subsection (/V turns display on)
  50.  
  51. The same sort of thing for uninitialized static data.
  52.  
  53. G. Mystery subsection (/X turns display off)
  54.  
  55. Borland added a new section offset to the header record, but I've never been
  56. able to find a unit that has anything there, so I've got no idea what it's for!
  57. INTRFC defaults to a generic dump of the section if you look at a unit with a
  58. "mystery subsection"; if you ever see one of these, could you drop me a line
  59. (and perhaps a copy of what INTRFC prints about the unit, and what you think is
  60. unusual about it)?
  61.  
  62. H. Unit list subsection (/U turns display on)
  63.  
  64. All units on which this one depends are listed, in variable length records.
  65.  
  66. I. Source names subsection (/S turns display on)
  67.  
  68. This section lists the source files, and .OBJ files that were linked into this
  69. unit.
  70.  
  71. J. Line lengths subsection (/M turns display on)
  72.  
  73. If debugging is turned on, the records here give the correspondence between
  74. source code lines and bytes in the code blocks.
  75.  
  76. II. CODE SECTION (/B turns display on)
  77.  
  78. This section contains the compiled object code, in the order listed in the
  79. code block subsection above.  I don't know if there is any separation between
  80. blocks.
  81.  
  82. III. CONST SECTION (/G turns display on)
  83.  
  84. The initialized data, in the order of the const blocks.
  85.  
  86. IV. CODE RELOCATION RECORDS (/R turns display on)
  87.  
  88. A big array of fixed length records, giving the relocation fixups for the code
  89. blocks.
  90.  
  91. V.  CONST RELOCATION RECORDS (/O turns display on)
  92.  
  93. An array in the same format as IV, giving the relocation fixups for the const
  94. blocks.  Used for fixups for the VMT tables of objects, and initialized
  95. pointer constants.
  96.